<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ include file="checkLogin.inc.jsp" %>

<%@ page import="java.util.List" %>
<%@ page import="kulstats.*" %>
<% Registry.questionnaireManager().fillqmap(); %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html> 
<head> 
	<title>Statistics - StAPP</title> 
	
	<%@ include file="mobileResources.inc.jsp" %>
	
</head> 

<body>
<div data-role="page" id="statsPage">
	<div data-role="header">
		<% WebCache.headerElement = "stats"; %>
		<%@ include file="mobileHeader.inc.jsp" %>
	</div><!-- /header -->
	<div data-role="content">
		<div id="stats_selections" class="ui-grid-a">
			<div id="stats_selection_type_div" class="ui-block-a">
	    		<fieldset data-role="controlgroup" id="stats_selection_type_div" style="margin-bottom:0px; margin-right: 3px;">
	         			<input type="radio" name="stats_selection_type" id="stats_selection_type1" value="time_spent" checked="checked" />
	        		 	<label for="stats_selection_type1">Time Spent</label>
	        		 	<input type="radio" name="stats_selection_type" id="stats_selection_type2" value="time_courses"  />
	        		 	<label for="stats_selection_type2">Courses</label>
	        		 	<input type="radio" name="stats_selection_type" id="stats_selection_type3" value="time_spare"  />
	        		 	<label for="stats_selection_type3">Spare Time</label>
	        		 	<input type="radio" name="stats_selection_type" id="stats_selection_type4" value="prod_total"  />
	        		 	<label for="stats_selection_type4">Productivity</label>
	   			</fieldset>
	   			<div  id="stats_selection_crse_div" style="display: none; width: 100%;margin-top:0px;margin-bottom:2px;" >
	   				<select id="stats_selection_crse" name="stats_selection_crse" style="width: 100%;">
<%
List<Course> userCourses = currentUser.getCourses();
//System.out.println(currentUser);
//System.out.println(userCourses);
for(Course c : userCourses) {
	if(c != null) {
%>
						<option value="<%=c.getCourseID() %>"><%=c.getName() %></option>
<%
	}
}
%>
	   				</select>
	   			</div>
			</div>
			<div id="stats_selection_perm_div" class="ui-block-b">
	    		<fieldset data-role="controlgroup" id="stats_selection_whom_div" style="margin-bottom:2px;">
	         			<input type="radio" name="stats_selection_whom" id="stats_selection_whom_pers" value="personal" checked="checked" />
	        		 	<label for="stats_selection_whom_pers">Personal</label>
	        		 	<input type="radio" name="stats_selection_whom" id="stats_selection_whom_glob" value="global"  />
	        		 	<label for="stats_selection_whom_glob">Global</label>
	   			</fieldset>
	    		<fieldset data-role="controlgroup" id="stats_selection_time_div" style="margin-top:1px;margin-bottom:2px;">
	         			<input type="radio" name="stats_selection_time" id="stats_selection_time_w" value="week" checked="checked" />
	        		 	<label for="stats_selection_time_w">Week</label>
	        		 	<input type="radio" name="stats_selection_time" id="stats_selection_time_m" value="month"  />
	        		 	<label for="stats_selection_time_m">Month</label>
	        		 	<input type="radio" name="stats_selection_time" id="stats_selection_time_s" value="semester"  />
	        		 	<label for="stats_selection_time_s">Semester</label>
	   			</fieldset>
	    		<fieldset data-role="controlgroup" id="stats_selection_char_div" style="margin-top:1px;">
	         			<input type="radio" name="stats_selection_char" id="stats_selection_char_pie" value="chart_pie" checked="checked" />
	        		 	<label for="stats_selection_char_pie">Pie</label>
	        		 	<input type="radio" name="stats_selection_char" id="stats_selection_char_bar" value="chart_bar"  />
	        		 	<label for="stats_selection_char_bar">Bars</label>
	   			</fieldset>
	   			<div id="stats_selection_offs_div" >
	   				<div id="stats_selection_offs_back" data-role="button" data-icon="arrow-l" data-iconpos="notext" style="float:left;"></div>
	   				<div id="stats_selection_offs_curr" style="float:left; line-height: 35px; vertical-align: bottom;"></div>
	   				<div id="stats_selection_offs_forw" data-role="button" data-icon="arrow-r" data-iconpos="notext" style="float:left;"></div>
	   				<input type="hidden" name="stats_selection_offs" id="stats_selection_offs" value="0" />
	   			</div>
			</div>
		</div>
		<div id="stats_loading" style="display: none; margin:50px 0px; padding:0px; text-align:center;"><img src="images/loader.gif" style="margin:0px auto;" /></div>
		<div id="stats_all_charts"></div>
		<!-- 
		<div id="stats_button_1" data-role="button">Time Spend</div>
		<div id="stats_button_2" data-role="button">Highscores</div>
		<div id="mainChart"></div> -->
	</div><!-- /content -->
	<div data-role="footer">
		<h4>&copy; 2011 - kulStats</h4>
	</div><!-- /footer -->
</div><!-- /page -->


</body>
</html>